/** @format */

export interface GetItemListByItemIdsResult {
  items: {
    item: tbItem[]
  }
  request_id: string
}

interface tbItem {
  approve_status?: string
  cid?: number
  delist_time?: string
  desc?: string
  detail_url?: string
  has_discount?: boolean
  has_invoice?: boolean
  has_showcase?: boolean
  has_warranty?: boolean
  list_time?: string
  modified?: string
  nick?: string
  num: number
  num_iid: number
  outer_id: string
  pic_url: string
  postage_id?: number
  price: string
  props?: string
  seller_cids?: string
  sold_quantity?: number
  title: string
  type: string
  valid_thru?: number
}

export interface QueryVipinfoResult {
  code: string
  result: {
    member_info?: {
      bind_status: number
      gmt_create: string
      grade: number
      grade_name: string
    }
  }
}

export interface BenefitSendResult {
  result_success: boolean
  result_code: string
  result_msg: string
  right_id: string
  prize_name: string
}

export interface GetOrderListResult {
  total_results: number
  has_next?: boolean
  trades: {
    trade: ITrade[]
  }
}

interface ITrade {
  orders: {
    order: IOrder[]
  }
  pay_time: string
  payment: string
  status: string
  tid: string
  type: string
}

interface IOrder {
  num: number
  num_iid: string
  oid: string
  outer_iid: string
  payment: string
  pic_path: string
  price: string
  refund_status: string
  status: string
  title: string
  total_fee: string
}

export interface IJDContext {
  openId: string
  shopId: string
  appKey: string
  appSecret: string
}

export interface ChangeCreditsinfo {
  quantity: number
  opt_type: string | number // 1增加 2扣减
  businessId?: string
  change_type?: number
  remark?: string
  account_date?: string
  need_account_date?: boolean
}

export interface BenefitInfo {
  couponId: number
  uuid: string
}

export interface ExtraInfo {
  fields: string
}

export interface ShopArgs {
  fields?: string
  session?: string
}

export interface GoodsItemInfo {
  fields: string
  pageNo: number
  title: string
  pageSize: number
  session?: string
}

/**
 * 购买信息参数
 */
export interface OrderParamsInfo {
  fields?: string
  startTime: string
  endTime: string
  status?: string
  type?: string
  pageNo?: number
  pageSize?: number
  useNext?: boolean /** 是否启用has_next的分页方式 */
  openId: string
  session?: string
}

export interface InstanceAppInfo {
  description: string
  ext_json: Record<string, any>
  icon: string
  name: string
  session?: string
  clients: string
  template_id: number
  template_version: string
}

// 这里的信息从实例化的时候拿
export interface OnlineAppInfo {
  clients: string
  app_id: number
  template_id: number
  template_version: string
  app_version: string
  session?: string
}

export interface UpdateAppInfo {
  clients: string
  app_id: number
  template_id: number
  template_version: string
  ext_json: Record<string, any>
  session?: string
  icon?: string
  desc?: string
  alias?: string
}

/**
 * 小部件配置参数
 */
export interface miniConfigAppInfo {
  appId: number
  version: string
  session?: string
}

export interface IMarkInfo {
  openId: string
  itemId: string
  skuId?: string
  status?: string
}

export interface addCartInfo {
  itemId: string
  num: number
}

export interface GoodsInfo {
  productId: number
}

export interface JdBeanInfo {
  requestId: string
  beanNum: number
  planId: number
  desc: string
}